package
{
	import com.greensock.TweenMax;
	import com.pesilo.base.BaseComponent;
	import com.pesilo.mvc.controller.ApplicationFacade;
	import com.pesilo.mvc.view.component.module.BackgroundContainerComponent;
	import com.pesilo.mvc.view.component.module.NavigationContainerComponent;
	import com.pesilo.mvc.view.component.module.ShowContainerComponent;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	public class Pesilo extends BaseComponent
	{
		
		public var container:Sprite;
		
		public var bgContainer:BackgroundContainerComponent;
		public var showContainer:ShowContainerComponent;
		public var navigationContainer:NavigationContainerComponent;
		
		public function Pesilo()
		{
			stage.align=StageAlign.TOP_LEFT;
			stage.scaleMode=StageScaleMode.NO_SCALE;
			super();
		}
		
		override public function initUI():void{
			container=new Sprite();
			this.addChild(container);
			
			bgContainer=new BackgroundContainerComponent();
			container.addChild(bgContainer);
			
			showContainer=new ShowContainerComponent();
			container.addChild(showContainer);
			
			navigationContainer=new NavigationContainerComponent();
			container.addChild(navigationContainer);
			
			TweenMax.delayedCall(1,test);
		}
		
		private function test():void{
			ApplicationFacade.getInstance(ApplicationFacade.NAME).sendNotification(ApplicationFacade.TEST_EVENT);
		}
		
		override public function initEvent(b:Boolean=true):void{
			if(b){
				
			}else{
				
			}
		}
		
		override public function initLocation():void{
			
		}
		
		override public function start():void{
			ApplicationFacade.getInstance(ApplicationFacade.NAME).startup(this);
			
			ApplicationFacade.getInstance(ApplicationFacade.NAME).sendNotification(ApplicationFacade.SHOW_EVENT);
		}
	}
}